<?php
namespace Anls\Controller;
use Think\Controller;
use Anls\Com\File;
use Anls\Com\Bar;
class KlineController extends AbstractTradeSupportController{
	
	public function index() {
		$this->display('Report/kline');
	}
	
	public function getData(){
	    $code = I('code','000001');
	    $content = File\FileHandle::getFileContentByFileName('stock', '1day', $code);
	    if(!strlen($content)>0) {
	        echo '';
	        exit();
	    }
	    $BarH = new Bar\BarHandle();
	    $_bar = $BarH->getBarInfo($content);
	   
	    echo json_encode($_bar);
	}
	
}